package com.mjk.common.ai.entity;

import com.mjk.common.base.model.BaseEntity;
import com.mjk.common.core.jdbc.annotation.ArcSharding;
import com.mjk.common.core.jdbc.annotation.Filed;
import com.mjk.common.core.jdbc.annotation.Id;
import com.mjk.common.core.jdbc.service.idgenerator.IdGenerateType;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 知识库实体
 */
@Data
@ArcSharding(dataSource = "pg", table = "adi_knowledge_base")
public class KnowledgeBase extends BaseEntity {

    @Id(type = IdGenerateType.AUTO_UUID)
    private Long id;

    @Filed(cloum = "create_time")
    private LocalDateTime createTime;

    @Filed(cloum = "update_time")
    private LocalDateTime updateTime;

    @Filed(cloum = "is_deleted", comment = "是否删除（0：未删除，1：已删除）")
    private Boolean isDeleted;

    @Filed(cloum = "uuid", comment = "uuid")
    private String uuid;

    @Filed(cloum = "title", comment = "名称")
    private String title;

    @Filed(cloum = "remark", comment = "描述")
    private String remark;

    @Filed(cloum = "is_public", comment = "是否公开")
    private Boolean isPublic;

    @Filed(cloum = "is_strict", comment = "是否严格模式")
    private Boolean isStrict;

    @Filed(cloum = "star_count", comment = "点赞数")
    private Integer starCount;

    @Filed(cloum = "item_count", comment = "知识点数量")
    private Integer itemCount;

    @Filed(cloum = "embedding_count", comment = "向量数")
    private Integer embeddingCount;

    @Filed(cloum = "owner_uuid", comment = "所属人uuid")
    private String ownerUuid;

    @Filed(cloum = "owner_id", comment = "所属人id")
    private Long ownerId;

    @Filed(cloum = "owner_name", comment = "所属人名称")
    private String ownerName;

    @Filed(cloum = "ingest_max_overlap", comment = "文档切割时重叠数量(按token来计)")
    private Integer ingestMaxOverlap;

    @Filed(cloum = "ingest_model_name", comment = "索引(图谱化)文档时使用的LLM,如不指定的话则使用第1个可用的LLM")
    private String ingestModelName;

    @Filed(cloum = "ingest_model_id", comment = "索引(图谱化)文档时使用的LLM,如不指定的话则使用第1个可用的LLM")
    private Long ingestModelId;

    @Filed(cloum = "retrieve_max_results", comment = "文档召回最大数量")
    private Integer retrieveMaxResults;

    @Filed(cloum = "retrieve_min_score", comment = "文档召回最小分数")
    private Double retrieveMinScore;

    @Filed(cloum = "query_llm_temperature", comment = "请求LLM时的temperature")
    private Double queryLlmTemperature;
}
